<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of arraycrop2dims</title>
  <meta name="keywords" content="arraycrop2dims">
  <meta name="description" content="Pads or crops I appropriately so that size(IC)==dims.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html matlab -->
<h1>arraycrop2dims
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Pads or crops I appropriately so that size(IC)==dims.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function IC = arraycrop2dims( I, dims, padelement ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Pads or crops I appropriately so that size(IC)==dims.  

 For each dimension d, if size(I,d) is larger then dims(d) then symmetrically crops along
 d (if cropping amount is odd crops one more unit from the start of the dimension).  If
 size(I,d) is smaller then dims(d) then symmetrically pads along d with padelement (if
 padding amount is even then pads one more unit along the start of the dimension).

 INPUTS
   I             - n dimensional array to crop window from
                   does not support cell arrays (except for cropping)
   dims          - dimensions to make I
   padelement    - [optional] element with which to pad (0 by default)

 OUTPUTS
   IC            - cropped array

 EXAMPLE
   I = randn(10);
   delta=1; IC = arraycrop2dims( I, size(I)-2*delta  );

 DATESTAMP
   29-Sep-2005  2:00pm

 See also <a href="arraycrop_full.html" class="code" title="function I = arraycrop_full( I, start_locs, end_locs, padelement )">ARRAYCROP_FULL</a>, PADARRAY</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="arraycrop_full.html" class="code" title="function I = arraycrop_full( I, start_locs, end_locs, padelement )">arraycrop_full</a>	Used to crop a rectangular region from an n dimensional array.</li><li><a href="checknumericargs.html" class="code" title="function [x,er] = checknumericargs( x, siz, integerflag, signflag )">checknumericargs</a>	Helper utility for checking numeric vector arguments.</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="../filters/FB_crop.html" class="code" title="function FBC = FB_crop( FB, delta )">FB_crop</a>	Crop a 2D filterbank (adjusting filter norms).</li><li><a href="../filters/FB_reconstruct_2D.html" class="code" title="function I2 = FB_reconstruct_2D( I, FB )">FB_reconstruct_2D</a>	Use to see how much image information is preserved in filter outputs.</li><li><a href="../images/apply_homography.html" class="code" title="function IR = apply_homography( I, H, method, bbox, show )">apply_homography</a>	Applies the homography defined by H on the image I.</li><li><a href="../images/convn_fast.html" class="code" title="function C = convn_fast( A, B, shape )">convn_fast</a>	Fast convolution, replacement for both conv2 and convn.</li><li><a href="../images/jitter_image.html" class="code" title="function IJ = jitter_image( I, nphis, maxphi, ntrans, maxtrans, jsiz, reflectflag, scales )">jitter_image</a>	Creates multiple, slightly jittered versions of an image.</li><li><a href="../images/montages2.html" class="code" title="function varargout = montages2( IS, montage2params, padsize )">montages2</a>	MONTAGES2 [4D] Used to display R sets of T images each.</li><li><a href="../images/optflow_corr.html" class="code" title="function [Vx,Vy,reliab] = optflow_corr( I1, I2, patch_r, search_r, sigma, thr, show )">optflow_corr</a>	Calculate optical flow using cross-correlation.</li><li><a href="cell2array.html" class="code" title="function Y = cell2array( X, padelement )">cell2array</a>	Converts a cell array into a regular array.</li></ul>
<!-- crossreference -->



<hr><address>Generated on Wed 03-May-2006 23:48:50 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>